<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page session="false" %>
<html>
<head>
	<title>Home</title>
</head>
<body>
	<form method="post" action="./register">
		<table border="1">
			<tr>
				<th>Name</th>
				<td><input type="text" name="name"></td>
			</tr>
			<tr>
				<th>Surname</th>
				<td><input type="text" name="surname"></td>
			</tr>
			<tr>
				<th>Email</th>
				<td><input type="text" name="email"></td>
			</tr>
			<tr>
				<th></th>
				<td><input type="submit" value="Add User"></td>
			</tr>
		</table>
	</form>
	
	<table border="1">
	<c:forEach items="${users}" var="user">
		<tr>
			<td><c:out value="${user.name}" /></td>
			<td><c:out value="${user.surname}" /></td>
			<td><c:out value="${user.email}" /></td>
		</tr> 	
	</c:forEach>
	<c:if test="${not empty error}">Error: ${error}</c:if>
	</table>
</body>
</html>
